$(document).ready(function(){
	$('#btnSearch').click(function(e){
		//e.preventDefault();
		var value = $('input[name=keyword]').val();
		if(value==''){
			alert('Please input keyword to search.');
			return false;
		}
	});
});

$(document).ready(function(){
	$('#select_file').click(function(e){
		e.preventDefault();
		openWin2();
		$('form input, form textarea').trigger('change');
	});
	$('.remove-image').click(function(e){
		e.preventDefault();
		$('#image').attr('src','');
		$('#path_image').val('');
		$('form input, form textarea').trigger('change');
	});
	$('.img-thumbnail #image').dblclick(function(e){
		e.preventDefault();
		openWin2();
		$('form input, form textarea').trigger('change');
	});
});
function openWin2(is_multi,flag)
{
	if(typeof is_multi=='undefined'){
		is_multi=false;
	}
	//Upload avatar profile by Ajax
	if(typeof flag=='undefined'){
		flag=false;
	}
    var multi=0;
    if(is_multi==true){
    	multi=1;	
    }
    var  parentId = $(this).parent().attr('id');
	var width = 900;
	var height = 520;
	var top = 100;
	var left = (window.innerWidth - width)/2;
    settings = 'width='+width+',height='+height+',top='+top+',left='+left+',resizable="no",toolbar="yes",scrollbars="no",status="no",location="no"';
	myWindow = window.open('/thirdParty/elfinder/elfinder.php?id='+parentId+'&pageId=language_list&is_multi='+multi+'&flag='+flag,'',settings);
	myWindow.focus();
}